<%-- 
    Document   : uriManager
    Created on : 2009-4-26, 18:47:49
    Author     : 47
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%
ljsystem.UriManager mgr=new ljsystem.UriManager();
java.util.Iterator itr=mgr.getAllUri().iterator();
bo.UriItem u=null;
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd">

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <%@include file="/main/head.jspf" %>
        <title>系统资源管理</title>
        <script language="javascript" type="text/javascript" charset="UTF-8">
            function selectAll(flag){
                var cbxArray=new Array();
                cbxArray=document.getElementsByName("uid");
                var i=0;
                for(i=0;i<cbxArray.length;i++){
                    cbxArray[i].checked=flag;
                }
                return false;
            }
            function deleteselected(){
                var r=confirm("你确定删除选中的资源吗？");
                if(r){
                    document.getElementById("myform").submit();
                }
                return false;
            }
            function deleteaction(uripath,uid){
                var r=confirm("你确定删除资源\n“"+uripath+"”\n吗？");
                if(r){
                    window.location="delUrido.jsp?uid="+uid;
                }
                return false;
            }
       </script>
    </head>
    <body>
        <%@include file="/main/bodyhead.jspf" %>
        <table align="center" border="1" cellpadding="0" cellspacing="0" width="100%">
            <tr>
                <td style="text-align:left;border-right:none;">
                    
                </td>
                <td style="text-align:right;">
                    <a href="addUri.jsp">注册新资源</a>
                    <a href="#" onclick="return selectAll(true)">全选</a>
                    <a href="#" onclick="return selectAll(false)">全不选</a>
                    <a href="#" onclick="return deleteselected()">删除</a>
                </td>
            </tr>
        </table>
        <br>
        <table align="center" border="1" cellpadding="2" cellspacing="0" width="600px"><tr><td>
                    <table align="center" border="1" cellpadding="0" cellspacing="0" width="800px">
                        <form id="myform" action="delUrido.jsp" method="post">
                        <th colspan="3" class="maintitle">系统资源</th>
                        <%
                        while(itr.hasNext()){
                            u=(bo.UriItem)itr.next();
                        %>
                        <tr class="infoline">
                            <td style="text-align:left;">
                                <input type="checkbox" name="uid" value="<%=u.uriId%>">
                                    <%=u.uriPath%>
                            </td>
                            <td style="text-align:left;"><%=u.memo%></td>
                            <td style="text-align:right;">
                                <a href="editUri.jsp?uid=<%=u.uriId%>">编辑</a>
                                <a href="#" onclick="return deleteaction('<%=u.uriPath%>','<%=u.uriId%>')">删除</a>
                            </td>
                        </tr>
                        <%}%>
                        </form>
                        <tr class="maintitle">
                            <td colspan="3">&nbsp;</td>
                        </tr>
                    </table>
        </td></tr></table>
    </body>
</html>
